
<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Hệ thống quản lí thuốc online</title>
</head>
<body>
	<div id="wrapper">
		<%@ include file="../../layout/menubar.jsp"%>
		<%@ include file="../../layout/left-menu.jsp"%>
		<%@ include file="../../layout/header.jsp"%>
        <div id="page-wrapper">
        <div class="page-content">

                <!-- begin PAGE TITLE ROW -->
                <div class="row">
                    <div class="col-lg-12">
                        <div class="page-title">
                            <ol class="breadcrumb">
                                <li><i class="fa fa-dashboard"></i>  <a href="">Quản lý cửa hàng thuốc</a>
                                </li>
                            </ol>
                        </div>
                    </div>
                    <!-- /.col-lg-12 -->
                </div>
                <!-- /.row -->
                <!-- end PAGE TITLE ROW -->

                <!-- begin ADVANCED TABLES ROW -->
                <div class="row">

                    <div class="col-lg-12">

                        <div class="portlet portlet-default">
                            <div class="portlet-heading">
                                <div class="portlet-title">
                                    <h4>Danh sách</h4>
                                </div>
                                <div class="clearfix"></div>
                            </div>
                            <div class="portlet-body">
                                <div class="table-responsive">
									<div class="row form-group">
										<div class="col-sm-6 col-xs-12" style="margin-top: 25px"></div>
										<div class="col-sm-6 col-xs-12" style="margin-top: 25px">
											<form action="list">
												<input type="hidden" value="listAllData" name="listAll" />
												<button type="submit"
													class="btn btn-default pull-right btn-square">
													<span class="glyphicon glyphicon-plus"></span>&nbsp;Hiển thị tất cả
												</button>
											</form>
										</div>
									</div>
                                    <table id="example-table" class="table table-striped table-bordered table-hover table-green">
                                        <thead>
                                            <tr>
                                            	<th>STT</th>      
                                            	<th>Tên</th>                                     	
                                                <th>Số điện thoại</th>
                                                <th>Địa chỉ</th>
                                                <th>Trạng thái</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                        	<%int i = 0; %>
											<c:forEach var="store" items="${stores}">
												<%i++;%>
												<tr>
													<td><%=i %></td>
													<td><a href="" data-toggle="modal"
														data-target="#modalUpdate"
														onclick="editButtonTouched(${store.getId()},'${store.getStoreName()}','${store.getPhoneNumber()}','${store.getAddress()}','${store.getStatus()}')">${store.getStoreName()}</a></td>
													<td>${store.getPhoneNumber()}</td>	
													<td>${store.getAddress()}</td>
													<td>${store.getStatus()}</td>
												</tr>
											</c:forEach>
										</tbody>
                                    </table>
                                </div>
                                <!-- /.table-responsive -->
                            </div>
                            <!-- /.portlet-body -->
							<div class="portlet-footer">
								<button type="submit"
									class="btn btn-default pull-right btn-square"
									data-toggle="modal" data-target="#modalCreate">
									<span class="glyphicon glyphicon-plus"></span>&nbsp;Thêm mới
								</button>
								<div class="clearfix"></div>
							</div>
							<!-- /.portlet-footer -->
						</div>
                        <!-- /.portlet -->

                    </div>
                    <!-- /.col-lg-12 -->

                </div>
                <!-- /.row -->

            </div>
            <!-- /.page-content -->

        </div>
        <!-- /#page-wrapper -->
        <!-- end MAIN PAGE CONTENT -->
        </div>
	<!-- Modal add user -->
	<%@ include file="create.jsp"%>
	<%@ include file="edit.jsp"%>
</body>
<script type="text/javascript">
	function editButtonTouched(id,name, phone ,address, status) {
	    document.getElementById("updateStoreId").value = id;
	    document.getElementById("updateName").value = name;
	    document.getElementById("updatePhone").value = phone;
	    document.getElementById("updateAddress").value = address;
	    document.getElementById("updateStatusInput").value = status;
	};
	
	function deleteUser() {
	    var id = document.getElementById("deleteuser").value;
	    var html = "";
	    $.ajax({
	        cache: false,
	        type: "GET",
	        url: "delete",
	        data: {
	            "userId": id
	        },
	        success: function (data) {
	            location.reload();
	        },
	        error: function (data) {
	            alert("error");
	        }
	    });
	};
</script>

<!-- Mirrored from themes.startbootstrap.com/flex-admin-v1.2/blank.html by HTTrack Website Copier/3.x [XR&CO'2013], Wed, 19 Mar 2014 06:24:44 GMT -->
</html>
